package com.cedric.yixianpai.game.cards.Sects.swordCards.d_YuanYing;

import com.cedric.yixianpai.game.Constants.CardType;
import com.cedric.yixianpai.game.Constants.Period;
import com.cedric.yixianpai.game.Status.DuelStatus;
import com.cedric.yixianpai.game.interfaces.SwordCard;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class Yun_ShanFeng extends SwordCard {
    /**
     * title:云剑·闪风
     * effect:4/8/12攻 再动
     */
    public Yun_ShanFeng(@Value("1") int lvl) {
        super("云剑·闪风");
        this.setLevel(lvl);
        this.setPeriod(Period.YUANYING);
        this.setDescription("4/8/12攻 再次行动");
        this.setCardType(CardType.YUN);
        if (1 == lvl) {
            this.setDamage(4);
        } else if (2 == lvl) {
            this.setDamage(8);
        } else if (3 == lvl) {
            this.setDamage(12);
        } else {
            throw new RuntimeException("Card Level Error!");
        }
    }

    @Override
    public boolean effect(DuelStatus Sta1, DuelStatus Sta2) {
        Sta1.attack(Sta2,this.getDamage());
        Sta1.getPlayerBuff().clearSwordIntent();
        if(Sta1.lastIs(CardType.YUN)){
            Sta1.setAgain();
        }
        return true;
    }
}
